#include<iostream>
using namespace std;
class Rect {
public:
	double l, h;
    Rect(double length, double height) : l(length), h(height) {}
    void perimeter() {
        cout << (l + h) * 2 << endl;
    }
    void area() {
        cout << l * h << endl;
    }
};
class Cubic : public Rect {
private:
    double z;
public:
    Cubic(double length, double height, double depth) : Rect(length, height), z(depth) {}
    void surfaceArea() {
        cout << (l * h * 2) + (l * z * 2) + (h * z * 2) << endl;
    }
    void volume() {
        cout << l * h * z << endl;
    }
};
class Pyramid {
private:
    double l, h, z;
public:
    Pyramid(double length, double height, double slantHeight) : l(length), h(height), z(slantHeight) {}
    void baseArea() {
        cout << (l * l) / 2 << endl;
    }
    void lateralSurfaceArea() {
        cout << l * z << endl;
    }
    void totalSurfaceArea() {
        cout << (l * l) / 2 + l * z << endl;
    }
    void volume() {
        cout << (l * l * h) / (2 * 3) << endl;
    }
};
int main() {
    double a, b, c, d, e, f, g, h, i, j, k, l;
    cin >> a >> b >> c >> d >> e >> f >> g >> h >> i >> j >> k >> l;
    Cubic A(a, b, c);
    A.surfaceArea();
    Cubic B(d, e, f);
    B.volume();
    Pyramid C(g, h, i);
    C.totalSurfaceArea();
    Pyramid D(j, k, l);
    D.volume();
    return 0;
}